package asteroids.model.programs.parsing.expressions;

public abstract class BinaryExpression extends ComposedExpression {

	protected BinaryExpression(E left, E right){
		if(!canHaveAsExpression(right)){
			setExpression(null, null);
		}
		if(!canHaveAsExpression(left))
			setExpression(null, null);
		setExpression(left, right);
	}
	
	public void setExpression(E e1, E e2){
		this.expression1 = e1;
		this.expression2 = e2;
	}
	
	public E getExpression1(){
		return this.expression1;
	}
	
	public E getExpression2(){
		return this.expression2;
	}
	
	private E expression1;
	private E expression2;
}
